package 笔试.同城58;

import java.util.Arrays;
import java.util.HashMap;

/**
 * @author:谢君臣
 * @Date:2021/9/11-19:48
 * @version:1.0
 * @function:
 */
public class Main01 {
    public static void main(String[] args) {

    }
    public int[] find (int[] arg) {
        // write code here
        HashMap<Integer,Integer> hashMap = new HashMap<>();
        for (int i = 0; i < arg.length; i++) {
            hashMap.put(arg[i],hashMap.getOrDefault(arg[i],0)+1);
        }
        int n = 0;
        int [] res = new int[arg.length];
        for (int i = 0; i < arg.length; i++) {
            if (hashMap.get(arg[i])==1)
                res[n++] = arg[i];
        }
        return Arrays.copyOfRange(res,0,n);

    }
}
